package com.qtenv.datasync.service.entity.msmapper;


import com.qtenv.datasync.service.entity.TerminalHistoryData;
import com.qtenv.datasync.service.entity.daiao.DaiAoHistoryData;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

@org.mapstruct.Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface DaiAoTerminalHistoryHMapper {
    DaiAoTerminalHistoryHMapper INSTANCE = Mappers.getMapper(DaiAoTerminalHistoryHMapper.class);

    @Mappings({
            @Mapping(source = "daiAoHistoryData.meterNumber", target = "terminalID"),
            @Mapping(source = "daiAoHistoryData.dVolume", target = "totalFlow"),
            @Mapping(source = "daiAoHistoryData.dForwardVolume", target = "readNumber"),
            @Mapping(source = "daiAoHistoryData.dReverseVolume", target = "reverseNumber"),
            @Mapping(source = "daiAoHistoryData.dFlow", target = "instantNumber"),
            @Mapping(source = "daiAoHistoryData.time", target = "readDate"),
    })
    TerminalHistoryData toTerminalHistoryData(String tenantId, DaiAoHistoryData daiAoHistoryData);
}
